import request from "@/utils/request";
export const uploaderFileApi = async (data) => {
    console.log("接口请求操作")
    let { file, fileMd5, chunkIndex, chunks } = data;
    let formData = new FormData();
    formData.append("multipartFile", file);
    formData.append("fileMd5", fileMd5)
    formData.append("chunkIndex", chunkIndex)
    formData.append("chunks", chunks);
    return request.post("/api/upload/file",formData, {
        // headers: {
        //     'Content-Type': 'multipart/form-data'
        // }
    });
}
export const unionFileApi = async (data)=>{
    let {fileName,fileMd5} = data;
    let formData = new FormData();
    formData.append("fileName",fileName);
    formData.append("fileMd5",fileMd5)
    return request.post("/api/union/file",formData);
}

//通过请求接口判断一下是否文件上传成功实现妙传的效果
export const queryUploadFileApi = (md5)=>{
    // let formData = new FormData();
    // formData.append("fileMd5",md5)
    return request({
        url:"/api/query/file/"+md5,
        method:"get",
        // data:formData
    })
}